package com.example.demo.service.impl;

import com.example.demo.dao.IUserDao;
import com.example.demo.entity.User;
import com.example.demo.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IUserServiceImpl implements IUserService {

    @Autowired
    IUserDao userDao;

    @Override
    public User doLogin(String username) {
       return userDao.doLogin(username);
    }

    @Override
    public List<User> getAllUserInfo() {
        return userDao.getAllUserInfo();
    }

    @Override
    public User checkName(String username) {
        return userDao.checkName(username);
    }

    @Override
    public void addUser(User user) {
        userDao.addUser(user);
    }

    @Override
    public User selectByName(String username) {
        return userDao.selectByName(username);
    }

    @Override
    public void insert(User user) {
        userDao.insert(user);
    }

    @Override
    public void update(User user) {
        userDao.update(user);
    }

    @Override
    public void delete(int id) {
        userDao.delete(id);
    }

    @Override
    public User selectById(int id) {
        return userDao.selectById(id);
    }

    @Override
    public List<User> selectAll() {
        return userDao.selectAll();
    }
}
